//CHART_REPO := http://jenkins-chartmuseum:8080
CURRENT=$(pwd)
NAME := $(FILE_NAME)
OS := $(shell uname)
IMAGE_NAME := $(Artifact_ID)
K8S_persistence_enabled := ${K8S_persistence_enabled}
K8S_persistence_subpath := ${K8S_persistence_subpath}
K8S_health_path := ${K8S_health_path}
NGINX_server_url := ${NGINX_server_url}
PROJECT_NAME := ${PROJECT_NAME}

replace:
ifeq ($(OS),Linux)
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" skaffold.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/dev/values.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/dev/requirements.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/preview/values.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/preview/requirements.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/demo/values.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/demo/requirements.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/bug/values.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/bug/requirements.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/$(IMAGE_NAME)/Chart.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" charts/$(IMAGE_NAME)/values.yaml
	sed -i -e "s/SUBPATH_NAME/$(K8S_persistence_subpath)/" charts/$(IMAGE_NAME)/values.yaml
	sed -i -e "s|HEALTH_PATH|$(K8S_health_path)|" charts/$(IMAGE_NAME)/values.yaml
	sed -i -e "s|SERVER_URL|$(NGINX_server_url)|g" charts/$(IMAGE_NAME)/templates/configmap.yaml
	sed -i -e "s/P_ENABLED/$(K8S_persistence_enabled)/" charts/$(IMAGE_NAME)/values.yaml
	sed -i -e "s|PROJECT_NAME|$(PROJECT_NAME)|" charts/$(IMAGE_NAME)/values.yaml
	sed -i -e "s/IMAGE_NAME/$(IMAGE_NAME)/" dockerfile/dockerfile-k8s

else
	echo "platfrom $(OS) not supported to release from"
	exit -1
endif